package service.impl;

        import dao.IBookDao;
        import dao.impl.BookDaoImpl;
        import pojo.Book_info;
        import service.IBookService;
        import util.PageHelper;

        import java.util.ArrayList;

public class BookServiceImpl implements IBookService {
    IBookDao ibd=new BookDaoImpl();
    @Override
    public ArrayList<Book_info> queryAll() {
        return ibd.selectAll();
    }

    @Override
    public int countQueryByType(Integer book_type) {
        return ibd.countSelectByType(book_type);
    }

    @Override
    public ArrayList<Book_info> queryByType(Integer book_type,PageHelper ph) {
        return ibd.selectByType(book_type,ph);
    }

    @Override
    public ArrayList<Book_info> queryByName(String book_name) {
        return ibd.selectByName(book_name);
    }

    @Override
    public ArrayList queryByStatus(Integer is_borrow) {
        return ibd.selectByStatus(is_borrow);
    }

    @Override
    public boolean changeStatusById(Integer book_id, Integer is_borrow) {
        return ibd.updateStatusById(book_id,is_borrow)>0;
    }
}
